What's a List? a Collection where the elements have order and position Does List have any methods in addition to those in Collection? 6.5 List Interface public interface List extends Collection { void add(int index, Object x); Object remove(int index); int indexOf(Object x); Object get(int index); Object set(int index, Object element); ListIterator listIterator(int pos); } Items on a List can be accessed based on their position. Why does Collection not support access by position? Collections may or may not have order and position DEMO (change Collection to List, write reverse method) make ArrayList of Strings (names) make LinkedList of Integers write reverse method show it works with both Why are there two implementations of List (ArrayList, LinkedList)? ArrayList is good for get/set LinkedList is good for insert/remove in middle of list DEMO (Timedemo.java) show time differences for ArrayList and LinkedList timedemo get on LinkedList timedemo insert on ArrayList What's a ListIterator? an iterator over a List that gives the elements in order (regular Iterators do not guarantee any particular order) a ListIterator can iterate both forward and backward Does ListIterator have any methods in addition to those in Iterator? 6.5.1 ListIterator Interface public interface ListIterator extends Iterator { boolean hasPrevious(); Object previous(); }